You are here: Trading System Programming > Reference > Classes > Order > Order Methods > getQuantity

getQuantity

The getQuantity method returns order's quantity.

Syntax

var getQuantity();

Return Value

This method returns quantity as a floating value.

Example

The following example demonstrates the use of getQuantity() method.

 

function start()

{

//retrieve account's open orders

var account = getAccount();

var openOrders = account.getOrders();

 

//loop through all orders

for(var i = 0; i < openOrders.length, i++)

{

var order = openOrders[i];

 

//only process orders which are limit orders which have quantity greater than 1000

if(order.getOrderType() ==ORDERTYPE_LIMIT && order.getQuantity() > 1000)

{

//proceed...

 

}

}

 

//proceed further...

}

 


Copyright © 2006-2009 ActiveTick LLC